import request from './request'

const baseUrl = {
  sysUrl: import.meta.env.VITE_SERVER
}

// sessionApi 获取用户会话
export const sessionApi = () => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/system/user/session'})
}
// numCodeApi 获取计算的图形验证码
export const numCodeApi = () => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/common/num-code'})
}
// selAreasApi 获取省市区
export const selAreasApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/common/areas', params})
}
// uploadApi 上传文件
export const uploadApi = (data) => {
  return request({method: 'POST', url: baseUrl.sysUrl + '/common/upload', headers: {'content-type': 'multipart/form-data'}, data})
}
// removeApi 删除文件
export const removeApi = (data) => {
  return request({method: 'POST', url: baseUrl.sysUrl + '/common/delete', data})
}
// downloadApi 下载文件
export const downloadApi = (data) => {
  return request({method: 'POST', url: baseUrl.sysUrl + '/common/download', data})
}
// loginApi 用户登录
export const loginApi = (data) => {
  return request({method: 'POST', url: baseUrl.sysUrl + '/system/user/login', data})
}
// newNoteApi 获取新消息通知
export const newNoteApi = () => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/system/notice/new'})
}
// exitApi 用户退出
export const exitApi = () => {
  return request({method: 'POST', url: baseUrl.sysUrl + '/system/user/exit'})
}
// menuApi 获取左侧导航菜单
export const menuApi = () => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/system/menu/menu'})
}

// saveConfApi 新增、修改全局配置
export const saveConfApi = (data) => {
  return request({method: 'POST', url: baseUrl.sysUrl + '/system/config/save', data})
}
// proConfsApi 删除、审核及取消审核全局配置
export const proConfsApi = (data) => {
  return request({method: 'POST', url: baseUrl.sysUrl + '/system/config/process', data})
}
// oneConfApi 获取全局配置详情
export const oneConfApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/system/config/one', params})
}
// pageConfsApi 获取全局配置分页列表
export const pageConfsApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/system/config/page', params})
}
// selConfsApi 获取全局配置数量，用于排序
export const selConfsApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/system/config/select', params})
}

// saveMenuApi 新增、修改菜单
export const saveMenuApi = (data) => {
  return request({method: 'POST', url: baseUrl.sysUrl + '/system/menu/save', data})
}
// delMenusApi 删除、审核，以及取消审核菜单
export const delMenusApi = (data) => {
  return request({method: 'POST', url: baseUrl.sysUrl + '/system/menu/deletes', data})
}
// oneMenuApi 获取菜单详情
export const oneMenuApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/system/menu/one', params})
}
// listMenusApi 获取菜单信息树形列表
export const listMenusApi = () => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/system/menu/list'})
}
// treeMenusApi 获取菜单信息树形
export const treeMenusApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/system/menu/tree', params})
}
// sortMenuApi 获取菜单树形列表
export const sortMenuApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/system/menu/sort', params})
}
// selMenuBtnsApi 获取菜单及按钮信息树形列表
export const selMenuBtnsApi = () => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/system/menu/select'})
}

// saveBtnApi 新增、修改按钮
export const saveBtnApi = (data) => {
  return request({method: 'POST', url: baseUrl.sysUrl + '/system/button/save', data})
}
// delBtnsApi 删除按钮
export const delBtnsApi = (data) => {
  return request({method: 'POST', url: baseUrl.sysUrl + '/system/button/deletes', data})
}
// oneBtnApi 获取按钮详情
export const oneBtnApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/system/button/one', params})
}
// pageBtnsApi 获取按钮分页列表
export const pageBtnsApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/system/button/page', params})
}
// sortBtnApi 获取按钮数量，用于排序
export const sortBtnApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/system/button/sort', params})
}

// saveRoleApi 新增、修改角色
export const saveRoleApi = (data) => {
  return request({method: 'POST', url: baseUrl.sysUrl + '/system/role/save', data})
}
// delRolesApi 删除角色
export const delRolesApi = (data) => {
  return request({method: 'POST', url: baseUrl.sysUrl + '/system/role/deletes', data})
}
// oneRoleApi 获取角色详情
export const oneRoleApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/system/role/one', params})
}
// pageRolesApi 获取角色信息分页列表
export const pageRolesApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/system/role/page', params})
}
// selRolesApi 获取角色下拉列表
export const selRolesApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/system/role/select', params})
}

// saveUserApi 新增、修改用户
export const saveUserApi = (data) => {
  return request({method: 'POST', url: baseUrl.sysUrl + '/system/user/save', data})
}
// proUsersApi 删除用户
export const proUsersApi = (data) => {
  return request({method: 'POST', url: baseUrl.sysUrl + '/system/user/process', data})
}
// oneUserApi 获取用户详情
export const oneUserApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/system/user/one', params})
}
// pageUsersApi 获取用户分页列表
export const pageUsersApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/system/user/page', params})
}
// mineApi 修改个人资料
export const mineApi = (data) => {
  return request({method: 'POST', url: baseUrl.sysUrl + '/system/user/mine', data})
}
// selUsersApi 获取下拉用户信息分页列表
export const selUsersApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/system/user/select', params})
}

// saveDictApi 新增、修改分类
export const saveDictApi = (data) => {
  return request({method: 'POST', url: baseUrl.sysUrl + '/system/dict/save', data})
}
// delDictsApi 删除、审核，以及取消审核分类
export const delDictsApi = (data) => {
  return request({method: 'POST', url: baseUrl.sysUrl + '/system/dict/deletes', data})
}
// oneDictApi 获取分类详情
export const oneDictApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/system/dict/one', params})
}
// listDictsApi 获取分类信息树形列表
export const listDictsApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/system/dict/list', params})
}
// treeDictsApi 获取分类信息树形列表
export const treeDictsApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/system/dict/tree', params})
}
// sortDictApi 获取分类数量，用于排序
export const sortDictApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/system/dict/sort', params})
}
// selDictsApi 获取分类数量，用于排序
export const selDictsApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/system/dict/select', params})
}
// selDictsApi 获取部门及用户的树形列表
export const selDeptsApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/system/dict/sel-dept', params})
}

// pageTagsApi 获取标签分页列表
export const pageTagsApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/system/tag/page', params})
}
// saveTagApi 保存标签
export const saveTagApi = (data) => {
  return request({method: 'POST', url: baseUrl.sysUrl + '/system/tag/save', data})
}
// delTagsApi 批量删除标签
export const delTagsApi = (data) => {
  return request({method: 'POST', url: baseUrl.sysUrl + '/system/tag/deletes', data})
}
// addTagApi 保存标签
export const addTagApi = (data) => {
  return request({method: 'POST', url: baseUrl.sysUrl + '/system/tag/add', data})
}
// delTagApi 删除标签
export const delTagApi = (data) => {
  return request({method: 'POST', url: baseUrl.sysUrl + '/system/tag/delete', data})
}

// upFileApi 添加文件
export const upFileApi = (data) => {
  return request({method: 'POST', url: baseUrl.sysUrl + '/system/file/upload', headers: {'content-type': 'multipart/form-data'}, data})
}
// upImgApi 上传图片
export const upImgApi = (data) => {
  return request({method: 'POST', url: baseUrl.sysUrl + '/system/file/image', headers: {'content-type': 'multipart/form-data'}, data})
}
// upVideoApi 上传视频
export const upVideoApi = (data) => {
  return request({method: 'POST', url: baseUrl.sysUrl + '/system/file/video', headers: {'content-type': 'multipart/form-data'}, data})
}
// delFilesApi 批量删除文件
export const delFilesApi = (data) => {
  return request({method: 'POST', url: baseUrl.sysUrl + '/system/file/deletes', data})
}
// updNameApi 修改文件名称
export const updNameApi = (data) => {
  return request({method: 'POST', url: baseUrl.sysUrl + '/system/file/upd-name', data})
}
// updTypeApi 修改文件分类
export const updTypeApi = (data) => {
  return request({method: 'POST', url: baseUrl.sysUrl + '/system/file/upd-type', data})
}
// oneFileApi 获取文件详情信息
export const oneFileApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/system/file/one', params})
}
// pageFilesApi 获取文件分页列表
export const pageFilesApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/system/file/page', params})
}

// pageLogsApi 获取日志信息分页列表
export const pageLogsApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/system/log/page', params})
}

// pageNotesApi 获取消息分页列表
export const pageNotesApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/system/notice/page', params})
}
// proNotesApi 删除消息
export const proNotesApi = (data) => {
  return request({method: 'POST', url: baseUrl.sysUrl + '/system/notice/deletes', data})
}
// readNoteApi 已读消息
export const readNoteApi = (data) => {
  return request({method: 'POST', url: baseUrl.sysUrl + '/system/notice/read', data})
}
// oneNoteApi 获取消息详情
export const oneNoteApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/system/notice/one', params})
}

// saveFeedApi 保存意见反馈信息
export const saveFeedApi = (data) => {
  return request({method: 'POST', url: baseUrl.sysUrl + '/system/feedback/save', data})
}
// proFeedsApi 删除、审核，以及取消审核意见反馈信息
export const proFeedsApi = (data) => {
  return request({method: 'POST', url: baseUrl.sysUrl + '/system/feedback/process', data})
}
// oneFeedApi 获取意见反馈详情信息
export const oneFeedApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/system/feedback/one', params})
}
// pageFeedsApi 获取意见反馈信息分页列表
export const pageFeedsApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/system/feedback/page', params})
}
// repliedFeedsApi 获取意见反馈信息回复列表
export const repliedFeedsApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/system/feedback/replied', params})
}

// saveInfoApi 新增、修改资讯信息
export const saveInfoApi = (data) => {
  return request({method: 'POST', url: baseUrl.sysUrl + '/infor/save', data})
}
// proInfosApi 删除、审核，以及取消审核资讯信息
export const proInfosApi = (data) => {
  return request({method: 'POST', url: baseUrl.sysUrl + '/infor/process', data})
}
// oneInfoApi 获取资讯详情信息
export const oneInfoApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/infor/one', params})
}
// pageInfosApi 获取资讯信息分页列表
export const pageInfosApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/infor/page', params})
}
// sortInfoApi 获取资讯信息数量
export const sortInfoApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/infor/sort', params})
}

// saveKeywordApi 新增、修改关键字
export const saveKeywordApi = (data) => {
  return request({method: 'POST', url: baseUrl.sysUrl + '/keyword/save', data})
}
// proKeywordsApi 删除、审核，以及取消审核关键字
export const proKeywordsApi = (data) => {
  return request({method: 'POST', url: baseUrl.sysUrl + '/keyword/process', data})
}
// oneKeywordApi 获取关键字详情
export const oneKeywordApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/keyword/one', params})
}
// pageKeywordsApi 获取关键字分页列表
export const pageKeywordsApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/keyword/page', params})
}
// selKeywordApi 下拉获取关键字
export const selKeywordApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/keyword/select', params})
}

// saveBaseApi 新增、修改题库
export const saveBaseApi = (data) => {
  return request({method: 'POST', url: baseUrl.sysUrl + '/exam/base/save', data})
}
// delBasesApi 删除题库
export const delBasesApi = (data) => {
  return request({method: 'POST', url: baseUrl.sysUrl + '/exam/base/deletes', data})
}
// oneBaseApi 获取题库详情
export const oneBaseApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/exam/base/one', params})
}
// pageBasesApi 获取题库分页列表
export const pageBasesApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/exam/base/page', params})
}
// sortBaseApi 获取题库排序
export const sortBaseApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/exam/base/sort', params})
}

// saveExamApi 新增、修改试卷
export const saveExamApi = (data) => {
  return request({method: 'POST', url: baseUrl.sysUrl + '/exam/save', data})
}
// procExamsApi 处理试卷
export const procExamsApi = (data) => {
  return request({method: 'POST', url: baseUrl.sysUrl + '/exam/process', data})
}
// oneExamApi 获取试卷详情
export const oneExamApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/exam/one', params})
}
// pageExamsApi 获取试卷分页列表
export const pageExamsApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/exam/page', params})
}
// selExamsApi 获取试卷列表
export const selExamsApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/exam/select', params})
}

// pageExamLogsApi 获取关键字分页列表
export const pageExamLogsApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/exam/log/page', params})
}
// oneExamLogApi 获取关键字详情
export const oneExamLogApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/exam/log/one', params})
}

// saveBrandApi 保存商品品牌
export const saveBrandApi = (data) => {
  return request({method: 'POST', url: baseUrl.sysUrl + '/goods/brand/save', data})
}
// proBrandsApi 处理商品品牌
export const proBrandsApi = (data) => {
  return request({method: 'POST', url: baseUrl.sysUrl + '/goods/brand/process', data})
}
// oneBrandApi 获取商品品牌详情
export const oneBrandApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/goods/brand/one', params})
}
// pageBrandsApi 获取商品品牌分页列表
export const pageBrandsApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/goods/brand/page', params})
}
// sortBrandApi 排序商品品牌
export const sortBrandApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/goods/brand/sort', params})
}
// selBrandsApi 获取商品品牌选择列表
export const selBrandsApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/goods/brand/select', params})
}
// listBrandsApi 获取商品品牌列表
export const listBrandsApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/goods/brand/list', params})
}

// saveTypeApi 保存商品分类
export const saveTypeApi = (data) => {
  return request({method: 'POST', url: baseUrl.sysUrl + '/goods/type/save', data})
}
// proTypesApi 处理商品分类
export const proTypesApi = (data) => {
  return request({method: 'POST', url: baseUrl.sysUrl + '/goods/type/process', data})
}
// oneTypeApi 获取商品分类详情
export const oneTypeApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/goods/type/one', params})
}
// listTypesApi 获取商品分类列表
export const listTypesApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/goods/type/list', params})
}
// treeTypesApi 获取商品分类列表
export const treeTypesApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/goods/type/tree', params})
}
// sortTypeApi 排序商品分类
export const sortTypeApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/goods/type/sort', params})
}
// selTypesApi 获取商品分类选择列表
export const selTypesApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/goods/type/select', params})
}

// saveSpuApi 保存商品
export const saveSpuApi = (data) => {
  return request({method: 'POST', url: baseUrl.sysUrl + '/goods/spu/save', data})
}
// proSpusApi 处理商品
export const proSpusApi = (data) => {
  return request({method: 'POST', url: baseUrl.sysUrl + '/goods/spu/process', data})
}
// oneSpuApi 获取商品详情
export const oneSpuApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/goods/spu/one', params})
}
// pageSpusApi 获取商品分页列表
export const pageSpusApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/goods/spu/page', params})
}
